package entity.User.bo.impl;

import entity.User.bo.UserBo;
import entity.User.dao.UserDAO;
import entity.User.model.User;

import java.util.List;

/**
 * Created by vanches on 28.12.14.
 */
public class UserBoImpl implements UserBo {
    UserDAO userDao;

    @Override
    public List<User> getAllUser() {
        return userDao.getAllUser();
    }

    @Override
    public void save(User user) {
        userDao.save(user);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(User user) {
        userDao.delete(user);
    }

    @Override
    public boolean checkLogin(String login) {
        return userDao.checkLogin(login);
    }

    @Override
    public User getUserById(int id) {
        return (User)userDao.getUserById(id);
    }

    @Override
    public User login(String login, String pass) {
        return userDao.login(login,pass);
    }

    public void setUserDao(UserDAO userDao) {
        this.userDao = userDao;
    }
}
